//WithCounter.jsx
import { useState } from 'react';

const WithCounter = (OriginalComponent: any) => {
  const NewComponent = () => {
    const [count, setCount] = useState(0);
    const incrementCount = () => {
      setCount(count + 1);
    };
    return <OriginalComponent count={count} incrementCount={incrementCount} />;
  };
  return NewComponent;
};

export default WithCounter;
